package dao

import (
	"errors"
	__ "hospital-srv/basic/proto"
	"hospital-srv/handler/models"
)

type Serve struct {
	__.UnimplementedHospitalServer
}

// 绑定设备
func BindingEquipment(userId, equipmentId int64) error {
	var relation models.UserEquipmentRelationship
	relation.UserId = int32(userId)
	relation.EquipmentId = int32(equipmentId)
	if err := relation.CreateRelation(); err != nil {
		return errors.New("绑定失败" + err.Error())
	}
	return nil
}
